@extends('Admin.layout.layout')
@section('before.css')
    <link href="{{asset('css/plugins/iCheck/custom.css')}}" rel="stylesheet">
@endsection
@section('content')
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>添加项目信息</h5>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="signupForm" action='{{$request_url}}'  method="post">
                        @if(isset($type) && $type == 'PUT')
                            {{method_field("PUT")}}
                        @endif
                        {!!  csrf_field() !!}
                        <input  name="id" value="{{old('project_id')}}" class="form-control" type="hidden">

                        <div class="form-group">
                            <label class="col-sm-3 control-label">发布信息类型：</label>
                            <div class="col-sm-5">
                                <select class="form-control valid" title="" name="type" id="type">
                                    <option value="">请选择</option>
                                    <option value="official" @if(old('type')=='official') selected @endif>官方</option>
                                    <option value="member" @if(old('type')=='member') selected @endif>会员</option>
                                    <option value="certified" @if(old('type')=='certified') selected @endif>认证会员</option>
                                </select>
                                @include('Admin.layout.tip',['field' => 'type'])
                            </div>
                        </div>
                        {{--<div class="form-group">--}}
                            {{--<label class="col-sm-3 control-label">项目类型：</label>--}}
                            {{--<div class="col-sm-5">--}}
                                {{--<input class="project_type" type="checkbox" title="" name="project_type[]" value="1">建筑设备自动化系统--}}
                                {{--<input class="project_type" type="checkbox" title="" name="project_type[]" value="2">多媒体及会议系统--}}
                                {{--<input class="project_type" type="checkbox" title="" name="project_type[]" value="3">安防系统--}}
                                {{--<input class="project_type" type="checkbox" title="" name="project_type[]" value="4">综合布线系统--}}
                                {{--<input class="project_type" type="checkbox" title="" name="project_type[]" value="5">通讯网络系统--}}
                                {{--<input class="project_type" type="checkbox" title="" name="project_type[]" value="6">智能楼宇系统--}}
                                {{--<input class="project_type" type="checkbox" title="" name="project_type[]" value="7">智能交通系统--}}
                                {{--<input class="project_type" type="checkbox" title="" name="project_type[]" value="8">智能家居系统--}}
                                {{--@include('Admin.layout.tip',['field' => 'project_type'])--}}
                            {{--</div>--}}
                        {{--</div>--}}
                        <div class="form-group">
                            <label class="col-sm-3 control-label">公告类型：</label>
                            <div class="col-sm-5">
                                <select class="form-control valid select1" title="" name="announcement_type" id="announcement_type">
                                    <option value="">请选择</option>
                                    <option value="1" @if(old('announcement_type')==1) selected @endif>采购预报</option>
                                    <option value="2" @if(old('announcement_type')==2) selected @endif>采购公告</option>
                                    <option value="3" @if(old('announcement_type')==3) selected @endif>中标成交公示</option>
                                    <option value="4" @if(old('announcement_type')==4) selected @endif>采购合同公告</option>
                                    <option value="5" @if(old('announcement_type')==5) selected @endif>竞争性磋商公告</option>
                                    <option value="6" @if(old('announcement_type')==6) selected @endif>单一来源公示</option>
                                    <option value="7" @if(old('announcement_type')==7) selected @endif>进口产品公示</option>
                                    <option value="8" @if(old('announcement_type')==8) selected @endif>采购文件或需求公示</option>
                                    <option value="9" @if(old('announcement_type')==9) selected @endif>公示</option>
                                </select>
                                @include('Admin.layout.tip',['field' => 'announcement_type'])
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">采购方式：</label>
                            <div class="col-sm-5">
                                <select class="form-control valid select1" title="" name="purchase_mode" id="purchase_mode">
                                    <option value="">请选择</option>
                                    <option value="1" @if(old('purchase_mode')==1) selected @endif>公开招标</option>
                                    <option value="2" @if(old('purchase_mode')==2) selected @endif>邀请招标</option>
                                    <option value="3" @if(old('purchase_mode')==3) selected @endif>竞争性谈判</option>
                                    <option value="4" @if(old('purchase_mode')==4) selected @endif>询价采购</option>
                                    <option value="5" @if(old('purchase_mode')==5) selected @endif>单一来源采购</option>
                                    <option value="6" @if(old('purchase_mode')==6) selected @endif>竞争性磋商</option>
                                </select>
                                @include('Admin.layout.tip',['field' => 'purchase_mode'])
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">采购类型：</label>
                            <div class="col-sm-5">
                                <select class="form-control valid select1" title="" name="purchase_type" id="purchase_type">
                                    <option value="">请选择</option>
                                    <option value="1" @if(old('purchase_type')==1) selected @endif>政府集中采购</option>
                                    <option value="2" @if(old('purchase_type')==2) selected @endif>部门集中采购</option>
                                    <option value="3" @if(old('purchase_type')==3) selected @endif>分散采购委托代理</option>
                                    <option value="4" @if(old('purchase_type')==4) selected @endif>分散采购自行组织</option>
                                    <option value="5" @if(old('purchase_type')==5) selected @endif>单位自行采购</option>
                                </select>
                                @include('Admin.layout.tip',['field' => 'purchase_type'])
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">城市选择：</label>
                            <div class="col-sm-5">
                                <input class="form-control" type="text" id="selected_city" title="" name="city" autocomplete="off" data-region-id="{{old('city_id')}}" value="{{old('region.name')}}"/>
                                <input type="hidden" value="{{old('city_id')}}" id="city_id" name="city_id"/>
                                <div class="clearbox">
                                    <img src="" alt="" width="10" height="10">
                                </div>
                                @include('Admin.layout.tip',['field' => 'city_id'])
                                @include('web.layout.city_hot')
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">业主单位：</label>
                            <div class="col-sm-5">
                                <input id="project_owner" name="project_owner" title="" value="{{old('project_owner')}}" class="form-control" type="text">
                                @include('Admin.layout.tip',['field' => 'project_owner'])
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">联系人：</label>
                            <div class="col-sm-5">
                                <input id="contacts" name="contacts" title="" value="{{old('contacts')}}" class="form-control" type="text">
                                @include('Admin.layout.tip',['field' => 'contacts'])
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">联系电话：</label>
                            <div class="col-sm-5">
                                <input id="phone" name="phone" title="" value="{{old('phone')}}" class="form-control" type="text">
                                @include('Admin.layout.tip',['field' => 'phone'])
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">标题：</label>
                            <div class="col-sm-5">
                                <input id="title" name="title" value="{{old('title')}}" title="" class="form-control" type="text">
                                @include('Admin.layout.tip',['field' => 'title'])
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">内容：</label>
                            <div class="col-sm-5" style="z-index:1;">
                                <script id="editor_id" name="content"  title="" style="min-height:300px;" type="text/plain">{!! old('content') !!}</script>
                                @include('Admin.layout.tip',['field' => 'content'])
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">审核状态：</label>
                            <div class="col-sm-5">
                                <select class="form-control valid select1" title="" name="check_status" id="check_status">
                                    <option value="">请选择</option>
                                    <option value="uncheck" @if(old('check_status')=='uncheck') selected @endif>未审核</option>
                                    <option value="pass" @if(old('check_status')=='pass') selected @endif>已通过</option>
                                    <option value="failed" @if(old('check_status')=='failed') selected @endif>审核失败</option>
                                </select>
                                @include('Admin.layout.tip',['field' => 'check_status'])
                            </div>
                        </div>
                        <div class="modal-footer">
                            <a href="{{asset('/foradmin/project')}}" class="btn btn-default pull-left">返回</a>
                            <button type="submit" class="btn btn-primary" id="btn_submit">
                                确定
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="{!!asset('/laravel-u-editor/ueditor.config.js')!!}"></script>
<script src="{!!asset('/laravel-u-editor/ueditor.all.min.js')!!}"></script>
<script>
    $(document).ready(function () {
        var ue_detail = UE.getEditor('editor_id', { initialFrameWidth: null });
        ue_detail.ready(function() {
            ue_detail.execCommand('serverparam', '_token', '{{ csrf_token() }}'); // 设置 CSRF token.
        });
    });


    {{--$('#btn_submit').click(function(){--}}
        {{--$.ajax({--}}
            {{--url: '{{url('/foradmin/project')}}',--}}
            {{--type: 'post',--}}
            {{--dataType: 'json',--}}
            {{--data: $('#signupForm').serialize(),--}}
            {{--success: function (data) {--}}
                {{--if (0 == data.code) {--}}
                    {{--layer.alert(data.message?data.message:data.data, {--}}
                        {{--icon: 1--}}
                    {{--}, function (index) {--}}
                        {{--layer.close(index);--}}
                        {{--location.href='/foradmin/article';--}}
                    {{--});--}}
                {{--} else {--}}
                    {{--layer.alert(data.message, {--}}
                        {{--icon: 2--}}
                    {{--}, function (index) {--}}
                        {{--layer.close(index);--}}
{{--//                            windows.lacation.href='/foradmin/article';--}}
                    {{--});--}}
                {{--}--}}
            {{--}--}}
        {{--});--}}
    {{--});--}}
</script>
@endsection
